import Vue from 'vue'
import {postRequest,putRequest,deleteRequest,getRequest,postFormRequest,putFormRequest,exportExcelGet,exportExcelPost} from '@/utils/request'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import '@/styles/index.scss' // global css

import 'default-passive-events'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/router/router-guard' // permission control

import {cloneDeep} from 'lodash'

Vue.prototype.postRequest = postRequest
Vue.prototype.putRequest = putRequest
Vue.prototype.deleteRequest = deleteRequest
Vue.prototype.getRequest = getRequest
Vue.prototype.postFormRequest = postFormRequest
Vue.prototype.putFormRequest = putFormRequest
Vue.prototype.exportExcelGet = exportExcelGet
Vue.prototype.exportExcelPost = exportExcelPost
Vue.prototype.cloneDeep = cloneDeep

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online! ! !
 */
// import { mockXHR } from '../mock'
// if (process.env.NODE_ENV === 'production') {
//   mockXHR()
// }

// set ElementUI lang to EN
Vue.use(ElementUI, { locale })

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App),
  created: () => console.log(process.env.NODE_ENV)
}).$mount('#app')
